package org.piwik.events
{
	import flash.events.Event;

	public class UserManagerEvent extends Event
	{
		public static const AUTH_LOADED:String = "authLoaded";
		public static const IO_ERROR:String = "userManager_io_error";
		public static const SECURITY_ERROR:String = "userManager_security_error";
		
		public var auth:String;
		public var rawData:Object;
		public var requestType:String;
		public var errorMessage:String;
		
		public function UserManagerEvent(type:String, 
										bubbles:Boolean=false, 
										cancelable:Boolean=false,
										auth:String = null,
										rawData:Object = null, 
										requestType:String = "undefined",
										errorMessage:String = "no error"
										)
		{
			super(type, bubbles, cancelable);
			
			this.auth = auth;
			this.rawData = rawData;
			this.requestType = requestType;
			this.errorMessage = errorMessage;
		}
		
		
		public override function clone( ):Event 
		{
			return new UserManagerEvent(type, bubbles, cancelable, auth, rawData, requestType, errorMessage);
		}

		public override function toString( ):String 
		{
			return formatToString("UserManagerEvent", "type", "bubbles", "cancelable", "eventPhase", "auth","rawData", "requestType", "errorMessage");
		}
		
	}
}